function e(e, t) {
    if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
}

Object.defineProperty(exports, "__esModule", {
    value: !0
});

var t = function() {
    function e(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), 
            Object.defineProperty(e, r.key, r);
        }
    }
    return function(t, n, r) {
        return n && e(t.prototype, n), r && e(t, r), t;
    };
}(), n = function() {
    function n() {
        e(this, n), this._events = {};
    }
    return t(n, [ {
        key: "listen",
        value: function(e, t, n) {
            var r = this._events[e];
            if (r) {
                if (r.length > 0 && r.some(function(e) {
                    return e.callback === t && e.target === n;
                })) return;
            } else this._events[e] = r = [];
            r.push({
                callback: t,
                target: n
            });
        }
    }, {
        key: "ignore",
        value: function(e, t, n) {
            this._events[e] && 0 !== this._events[e].length && (this._events[e] = this._events[e].filter(function(e) {
                return e.callback !== t || e.target !== n;
            }));
        }
    }, {
        key: "trigger",
        value: function(e, t) {
            var n = this._events[e];
            if (n && 0 !== n.length) {
                var r = Array.prototype.slice.call(arguments, 1);
                n.forEach(function(e) {
                    e.callback.apply(e.target, r);
                });
            }
        }
    } ]), n;
}();

exports.default = n;